function run () {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      return reject(new Error('fail'))
    })
  }).then(res => {
    console.log('success', res)
  }).catch(e => {
    console.log('error', e)
  })
}
run()
